//
//  MyMessageTableViewCell.m
//  ZhiBoYuan
//
//  Created by coder_di on 2018/4/17.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "MyMessageTableViewCell.h"

@implementation MyMessageTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //添加UI
        [self addUI];
    }
    return self;
}

-(void)addUI{
    
    self.imageVC = [[UIImageView alloc]initWithFrame:CGRectMake(20 * KscreenWidth, 20 * KscreenHeight, 50 * KscreenWidth, 50 * KscreenHeight)];
    self.imageVC.layer.masksToBounds = YES;
    self.imageVC.userInteractionEnabled = YES;
    self.imageVC.contentMode = UIViewContentModeScaleAspectFill;
    self.imageVC.clipsToBounds = YES;
    self.imageVC.layer.cornerRadius = 25 * KscreenWidth;
    [self.imageVC setImage:[UIImage imageNamed:@"图层12"]];
//    self.imageVC.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.imageVC];
    
    self.nameLable = [[UILabel alloc]initWithFrame:CGRectMake(90 * KscreenWidth,20 * KscreenHeight,100* KscreenWidth, 25 * KscreenHeight)];
    self.nameLable.text = @"系统通知";
    self.nameLable.font = [UIFont systemFontOfSize:18 * KscreenWidth];
    [self.contentView addSubview:self.nameLable];
    
    self.timeLable = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth - 120 * KscreenWidth,20 * KscreenHeight, 100* KscreenWidth, 25 * KscreenHeight)];
    self.timeLable.text = @"12月23日";
    self.timeLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    self.timeLable.textColor = hui4Color;
    self.timeLable.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:self.timeLable];
    
    
    self.messageLable = [[UILabel alloc]initWithFrame:CGRectMake(90 * KscreenWidth,50 * KscreenHeight,ScreenWidth - 140* KscreenWidth, 25 * KscreenHeight)];
    self.messageLable.text = @"系统通知单卡忘不了让旅程啦啊华晨弄额而非哪玩哪李威安斯利牛肉粉";
    self.messageLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    self.messageLable.textColor = hui4Color;
    [self.contentView addSubview:self.messageLable];
    
    self.countLable = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth - 50 * KscreenWidth,53 * KscreenHeight,20 * KscreenWidth, 20 * KscreenHeight)];
    self.countLable.text = @"15";
    self.countLable.layer.masksToBounds = YES;
    self.countLable.backgroundColor = [UIColor redColor];
    self.countLable.textColor = [UIColor whiteColor];
    self.countLable.textAlignment = NSTextAlignmentCenter;
    self.countLable.layer.cornerRadius = 10 * KscreenWidth;
    self.countLable.font = [UIFont systemFontOfSize:15 * KscreenWidth];
    
    [self.contentView addSubview:self.countLable];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
